import request from '@/utils/request'

// 查询小区信息列表
export function listCommunity(query) {
  return request({
    url: '/property/community/list',
    method: 'get',
    params: query
  })
}

// 查询小区信息详细
export function getCommunity(id) {
  return request({
    url: '/property/community/' + id,
    method: 'get'
  })
}

// 新增小区信息
export function addCommunity(data) {
  return request({
    url: '/property/community',
    method: 'post',
    data: data
  })
}

// 修改小区信息
export function updateCommunity(data) {
  return request({
    url: '/property/community',
    method: 'put',
    data: data
  })
}

// 删除小区信息
export function delCommunity(id) {
  return request({
    url: '/property/community/' + id,
    method: 'delete'
  })
}

// 导出小区信息
export function exportCommunity(query) {
  return request({
    url: '/property/community/export',
    method: 'get',
    params: query
  })
}


// 设置会计期间
export function fiscalPeriod(data) {
  return request({
    url: '/property/community/fiscalPeriod',
    method: 'post',
    data: data
  })
}

// 查询小区车辆信息
export function getCommunityParking(id) {
  return request({
    url: '/property/community/getCommunityParking/' + id,
    method: 'get'
  })
}


// 查询小区场地信息
export function getCommunitySite(id) {
  return request({
    url: '/property/community/getCommunitySite/' + id,
    method: 'get'
  })
}

// 查询小区广告位信息
export function getCommunityAdvert(id) {
  return request({
    url: '/property/community/getCommunityAdvert/' + id,
    method: 'get'
  })
}

//初始化账期
export function initCurrentFiscalPeriod(data) {
  return request({
    url: '/property/community/initFiscalPeriod',
    method: 'post',
    data: data
  })
}
